#ifndef _windows_information_h_
#define _windows_information_h_

#include <string>
#include <vector>
#include "I_Windows_Manager.h"

class Windows_Information
{
public:
	friend class Windows_Information_Collection;
	Windows_Information(const char * win_root, Windows_Edition ver);
	virtual ~Windows_Information();
	int	set_directories(const char * path, Path_Token token = SET_PATH_FROM_WINDOWS_DIR);
	int	set_windows_root_directory(const char *dir) {return set_directories(dir);}
	const char *get_directorie(Path_Token token = WINDOWS_DIR) const;
	Windows_Edition get_windows_version() const;

private:
	Windows_Information(const Windows_Information &);
	
	Windows_Edition	version_;
	int	 user_count_;
	std::string	directories_[SET_PATH_FROM_WINDOWS_DIR];
	std::string	partition_;
};

class	Windows_Information_Collection
{
public:	
	typedef std::vector<const Windows_Information *> Windows_Info_Collection;
	Windows_Information_Collection();
	virtual ~Windows_Information_Collection();
	int	add_windows_information(const Windows_Information * win_info);
	int	del_windows_information(const Windows_Information * win_info);
	const Windows_Information * get_windows_information(size_t win_id) const;
	const Windows_Information * get_windows_information(const char * win_root) const;
	Windows_Info_Collection & enum_all_windows() const; 
	int	get_windows_count() const;
	
private:
	void	clear_all_information();
	// 检查已有的windows信息集中是否已存在与win_info相同的信息结构，通过windows根目录进行判断
	bool	is_this_already_exist(const Windows_Information * win_info) const;
	// 在已有的windows信息集中查找与给定windows信息结构地址相同的元素
	Windows_Info_Collection::iterator 
	find_windows_info_referrence(const Windows_Information * win_info);
	
	Windows_Info_Collection windows_info_collection_;
};

#endif
